import com.qf.ProjectApplication;
import com.qf.mapper.ContractorMapper;
import com.qf.mapper.DeveloperMapper;
import com.qf.mapper.ProjectMapper;
import com.qf.mapper.StageMapper;
import com.qf.model.Contractor;
import com.qf.model.Developer;
import com.qf.model.Project;
import com.qf.model.Stage;
import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import java.util.List;

@SpringBootTest(classes = ProjectApplication.class)
@RunWith(SpringRunner.class)
public class findAll {
    @Autowired
    private ProjectMapper projectMapper;
    @Autowired
    private DeveloperMapper developerMapper;
    @Autowired
    private StageMapper stageMapper;

    @Autowired
    private ContractorMapper contractorMapper;
    @Test
    public void test(){
        System.out.println(111);
        List<Project> projects = projectMapper.findAll();
        projects.stream().forEach(o-> System.out.println(o));

    }
    @Test
    public void test1(){
        List<Project> page = projectMapper.findPage(1, 5);
        for (Project project:page
             ) {
            System.out.println(project);
        }
        }

    @Test
    public void devFindAll(){
        List<Developer> developers = developerMapper.findAll();
        developers.stream().forEach(o-> System.out.println(o));

    }

    @Test
    public void devFindPage(){
        List<Developer> page = developerMapper.findPage(0, 3);
        page.stream().forEach(o-> System.out.println(o));
    }

    @Test
    public void findByDid(){
        Developer developer = developerMapper.findByDid("0ad30e94d9fe423dbf04687be8ad4685");
        System.out.println(developer);
    }

    @Test
        public void findByCid(){
        Contractor con = contractorMapper.findByCid("69c3335642d54d81ad50fbc5b8bb972f");
        System.out.println(con);
    }
    @Test
    public void stageAll(){
        List<Stage> page = stageMapper.findPage(0, 5);
        page.stream().forEach(o-> System.out.println(o));
    }
}





